package net.mysoft.budgetsoft.system.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * 
 * @author dagongPGP v1.0
 * @link <a href=http://www.mysoft.net>北京大公信软科技有限公司</a>
 * 
 * @version $Revision: 1.00 $Date: 2013-02-06 11:02:08
 */
//@Entity
//@Table(name = "YongHu")
public class TYongHu implements java.io.Serializable {
	private String bianHao;
	private String xingMing;
	private String dengLuM;
	private String miMa;
	private Integer zhuangTai;
	private String beiZhu;

	// private Set<XiangMuJbxx> xiangMuJbxxSet;
	private Set<TYongHuJS> tYongHuJSSet;

	@Id
	@GeneratedValue(generator = "IDGenerator")
	@GenericGenerator(name = "IDGenerator", strategy = "net.mysoft.framework.util.IDGenerator", 
			parameters = { @Parameter(value = "SEQ_YongHu", name = "seq") })
	@Column(name = "BianHao", unique = true, nullable = false)
	public String getBianHao() {
		return bianHao;
	}

	public void setBianHao(String bianHao) {
		this.bianHao = bianHao;
	}

	@Column(name = "XingMing")
	public String getXingMing() {
		return this.xingMing;
	}

	public void setXingMing(String xingMing) {
		this.xingMing = xingMing;
	}

	@Column(name = "DengLuM")
	public String getDengLuM() {
		return this.dengLuM;
	}

	public void setDengLuM(String dengLuM) {
		this.dengLuM = dengLuM;
	}

	@Column(name = "MiMa")
	public String getMiMa() {
		return this.miMa;
	}

	public void setMiMa(String miMa) {
		this.miMa = miMa;
	}

	@Column(name = "ZhuangTai")
	public Integer getZhuangTai() {
		return zhuangTai;
	}

	public void setZhuangTai(Integer zhuangTai) {
		this.zhuangTai = zhuangTai;
	}

	@Column(name = "BeiZhu")
	public String getBeiZhu() {
		return beiZhu;
	}

	public void setBeiZhu(String beiZhu) {
		this.beiZhu = beiZhu;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tYongHu")
	public Set<TYongHuJS> gettYongHuJSSet() {
		return tYongHuJSSet;
	}

	public void settYongHuJSSet(Set<TYongHuJS> tYongHuJSSet) {
		this.tYongHuJSSet = tYongHuJSSet;
	}

	@Override
	public int hashCode() {
		int prime = 0;
		prime += this.getBianHao().hashCode();
		return prime;
	}

	@Override
	public boolean equals(Object obj) {
		boolean isEquals = false;
		if (obj != null && this.getClass() == obj.getClass()) {
			TYongHu clazz = (TYongHu) obj;
			if (clazz.getBianHao().equals(this.getBianHao()))
				isEquals = true;
			return isEquals;
		}
		return isEquals;
	}

}